package com.api.shopapi.service.impl;


import com.api.shopapi.entity.Zone;
import com.api.shopapi.mapper.ZoneMapper;
import com.api.shopapi.service.ZoneService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ZoneServiceImplOne")
public class ZoneServiceImpl implements ZoneService {

    @Autowired
    private ZoneMapper zoneMapper;

    @Override
    public int insert(Zone zone){
        return zoneMapper.insert(zone);
    }

    @Override
    public int deleteByZoneCode(String zoneCode){
        return zoneMapper.deleteByZoneCode(zoneCode);
    }

    @Override
    public int updateByZoneCode(Zone zone){
        return zoneMapper.updateByZoneCode(zone);
    }

    @Override
    public Zone getByZoneCode(String zoneCode){
        return zoneMapper.getByZoneCode(zoneCode);
    }

    @Override
    public List<Zone> getList() {
        return zoneMapper.getList();
    }

    @Override
    public List<Zone> getListByParentZoneCode(@Param("parentZoneCode")String parentZoneCode){
        return zoneMapper.getListByParentZoneCode(parentZoneCode);
    }

    @Override
    public List<Zone> getListByParentZoneCodeGovernmentCode(@Param("parentZoneCode") String parentZoneCode, String governmentCode){
        return zoneMapper.getListByParentZoneCodeGovernmentCode(parentZoneCode,governmentCode);
    }

    @Override
    public List<Zone> getListByParentZoneCodeGovernmentCode1(@Param("zoneCode") String zoneCode, String governmentCode){
        return zoneMapper.getListByParentZoneCodeGovernmentCode1(zoneCode,governmentCode);
    }

    @Override
    public List<Zone> getZone(String governmentCode) {
        return zoneMapper.getListByGovernmentCode(governmentCode);
    }

    @Override
    public Zone getZoneList(String parentZoneCode, String governmentCode) {
        return zoneMapper.getZoneList(parentZoneCode,governmentCode);
    }

    @Override
    public Zone getByName(String name, String governmentCode) {
        return zoneMapper.getByName(name, governmentCode);
    }

    @Override
    public List<Zone> getListByGovernmentCode(String governmentCode) {
        return zoneMapper.getListByGovernmentCode(governmentCode);
    }

    @Override
    public Zone getByByParentZoneCode(@Param("parentZoneCode")String parentZoneCode) {
        return zoneMapper.getByByParentZoneCode(parentZoneCode);
    }


}
